<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-','%mfile')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('管理')"></div>
        <div th:replace="common/search::search('%add%addfile%sheng%hytype')"></div>
    </div>
</div>

<!--添加Kehu模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add" onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商家名</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="mname"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系人</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="name"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">行业类型</label>
                                                <div class="col-sm-8">
                                                    <!--<input class="form-control" name="hytype" type="text"-->
                                                           <!--maxlength="50"/>-->
                                                    <select class="form-control" name="hytype" id="hytype2">
                                                        <option th:each="c:${hylist}" th:value="${c.code}" th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">备注</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="remark" maxlength="100"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">手机号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="phone"
                                                           type="number" isPhone maxlength="11"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">座机号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="telephone"
                                                           type="text" maxlength="20"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">省市</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="areacode" id="areacode2"
                                                            onchange="shengChange(this.value,'areacode2','shicode2','area2')">
                                                        <option th:each="c:${shenglist}" th:value="${c.code}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">市区</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="shicode" id="shicode2"
                                                            onchange="shiChange('shicode2','shi2')">
                                                        <option th:each="c:${shilist}" th:value="${c.code}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">地址</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="address"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">邮箱</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="email"
                                                           type="email" maxlength="60"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">备注</label>
                                                <div class="col-sm-10">
                                                            <textarea name="remark" class="form-control"
                                                                      maxlength="100"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">经度</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="longitude"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">纬度</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="latitude"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否微信用户</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isWxuser" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">启用状态</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <!--<button class="btn btn-primary" type="submit">保存内容</button>-->
                                            <button class="btn btn-primary" type="button" onclick="add()">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="area2" name="area" type="hidden" value=""/>
                                    <input id="shi2" name="shi" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Kehu模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商家名</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="mname" name="mname"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系人</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="name" name="name"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">行业类型</label>
                                                <div class="col-sm-8">
                                                    <!--<input class="form-control" name="hyname" id="hyname" type="text" maxlength="50"/>-->
                                                    <select class="form-control" name="hytype" id="hytype">
                                                        <option th:each="c:${hylist}" th:value="${c.code}" th:text="${c.name}"></option>
                                                    </select>
                                                    <!--<select class="form-control" name="hytype" >-->
                                                    <!--<option value="">请选择</option>-->
                                                    <!--</select>-->
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">手机号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="phone" name="phone"
                                                           type="number" isPhone maxlength="11"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">座机号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="telephone" name="telephone"
                                                           type="text" maxlength="20"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">省市</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="areacode" id="areacode"
                                                            onchange="shengChange(this.value,'areacode','shicode','area')">
                                                        <option th:each="c:${shenglist}" th:value="${c.code}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">市区</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="shicode" id="shicode"
                                                            onchange="shiChange('shicode','shi')">
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">邮箱</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="email" name="email" maxlength="60"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">地址</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="address" name="address"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">备注</label>
                                                <div class="col-sm-10">
                                                            <textarea id="remark" name="remark" class="form-control"
                                                                      maxlength="100"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">经度</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="longitude" name="longitude"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">纬度</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="latitude" name="latitude"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否微信用户</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isWxuser" name="isWxuser" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">启用状态</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="button" onclick="modify()">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="id" name="id" type="hidden" value=""/>
                                    <input id="area" name="area" type="hidden" value=""/>
                                    <input id="shi" name="shi" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--添加Kehu模态框-->
<div id="modal-add-file" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">添加名单数据</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="fform" method="post" class="form-horizontal" action="addfile"
                                      onsubmit="return checkAddFile()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">行业</label>
                                                <div class="col-sm-8">
                                                    <!--<input class="form-control" id="hyname3" name="hyname"/>-->
                                                    <select class="form-control" name="hytype" id="hytype3">
                                                        <option th:each="c:${hylist}" th:value="${c.code}" th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">省市</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="areacode" id="areacode3"
                                                            onchange="shengChange(this.value,'areacode3','shicode3','area3')">
                                                        <option th:each="c:${shenglist}" th:value="${c.code}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">市区</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="shicode" id="shicode3"
                                                            onchange="shiChange('shicode3','shi3')">
                                                        <option th:each="c:${shilist}" th:value="${c.code}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">名单数据Excel</label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="button" onclick="saveaddfile()">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white" href="#modal-add-file">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="path" name="path" type="hidden" value=""/>
                                    <input id="area3" name="area" type="hidden" value=""/>
                                    <input id="shi3" name="shi" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/kehu.js"></script>
</body>
</html>
